namespace KanbanBoard.Data
{
    using Core;
    using Core.DataInterfaces;

    using NHibernate.Criterion;

    using SharpArch.Data.NHibernate;

    public class UserRepository : Repository<User>, IUserRepository
    {
        public User LogIn(string userName, string password)
        {
            var criteria = Session.CreateCriteria<User>().SetCacheable(true)
               .Add(Restrictions.Eq("LoginName", userName))
               .Add(Restrictions.Eq("Password", password));

            return criteria.UniqueResult<User>();
        }
    }
}